 package com.lj.mcore.entity;

 import com.lj.mcore.domain.IdEntity;
 import jakarta.persistence.*;
 import org.hibernate.annotations.CreationTimestamp;
 import org.hibernate.annotations.UpdateTimestamp;

 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;


 @Entity
 @Table(name="shopping_storecart")
 public class StoreCart extends IdEntity
 {
 
   @ManyToOne(fetch = FetchType.LAZY)
   private Store store;

   @Column(precision=12, scale=2)
   private BigDecimal total_price;
 
   @ManyToOne(fetch=FetchType.LAZY)
   private User user;

   @Column(columnDefinition="int default 0")
   private int sc_status;

   @UpdateTimestamp
   @Temporal(TemporalType.TIMESTAMP)
   private Date updateTime;

   @OneToMany(mappedBy="storeCart",fetch = FetchType.LAZY)
   List<GoodsCart> goodsCarts = new ArrayList<>();

     public Date getUpdateTime() {
         return updateTime;
     }

     public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }

     public List<GoodsCart> getGoodsCarts() {
       return goodsCarts;
   }

   public void setGoodsCarts(List<GoodsCart> goodsCarts) {
       this.goodsCarts = goodsCarts;
   }

   public int getSc_status()
   {
     return this.sc_status;
   }
 
   public void setSc_status(int sc_status) {
     this.sc_status = sc_status;
   }
 
   public User getUser() {
     return this.user;
   }
 
   public void setUser(User user) {
     this.user = user;
   }
 
   public Store getStore() {
     return this.store;
   }
 
   public void setStore(Store store) {
     this.store = store;
   }
 
   public BigDecimal getTotal_price() {
     return this.total_price;
   }
 
   public void setTotal_price(BigDecimal total_price) {
     this.total_price = total_price;
   }
 }



 
 